
//房间信息

const UerInfoZt = require('./uerInfoZt');

class RoomInfo {
    constructor(roomId) {
        this.roomId = roomId;
        this.users = {};
        //标记两个人是否答完
        this.answerlen = 0;
        //标记当前轮打了多少道题
        this.topicLen = 0;
    }

    setRoomUser(uid, client){
        if(!this.users[uid]){
            this.users[uid] = new UerInfoZt(uid);
        }
        this.users[uid].setClient(client);
    }

    setRoomUserTimeAnScore(uid, score, time){
        if(!this.users[uid]){
            this.users[uid] = new UerInfoZt(uid);
        }
        this.users[uid].setTotalScore(score);
        this.users[uid].setTotalTime(time);

    }
}

module.exports = RoomInfo;